﻿<template>
  <div>
    <a-card :bordered="false" :bodyStyle="tstyle">

      <div class="table-page-search-wrapper" v-if="hasPerm('OutpMr:page')">
        <a-form layout="inline">
          <a-row :gutter="48">
            <a-col :md="8" :sm="24">
              <a-form-item label="VISIT_NO ">
                <a-input v-model="queryParam.visitNo" allow-clear placeholder="请输入VISIT_NO "/>
              </a-form-item>
            </a-col>
            <a-col :md="8" :sm="24">
              <a-form-item label="PATIENT_NAME ">
                <a-input v-model="queryParam.patientName" allow-clear placeholder="请输入PATIENT_NAME "/>
              </a-form-item>
            </a-col><template v-if="advanced"><a-col :md="8" :sm="24">
                <a-form-item label="OPER_DATE ">
                  <a-date-picker style="width: 100%" placeholder="请选择OPER_DATE " v-model="queryParam.operDateDate" @change="onChangeoperDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="DOCTOR_NAME ">
                  <a-input v-model="queryParam.doctorName" allow-clear placeholder="请输入DOCTOR_NAME "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="DOCTOR_CODE ">
                  <a-input v-model="queryParam.doctorCode" allow-clear placeholder="请输入DOCTOR_CODE "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="ILLNESS_DESC ">
                  <a-input v-model="queryParam.illnessDesc" allow-clear placeholder="请输入ILLNESS_DESC "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="ANAMNESIS ">
                  <a-input v-model="queryParam.anamnesis" allow-clear placeholder="请输入ANAMNESIS "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="FAMILY_ILL ">
                  <a-input v-model="queryParam.familyIll" allow-clear placeholder="请输入FAMILY_ILL "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="MARITAL_STATUS ">
                  <a-input v-model="queryParam.maritalStatus" allow-clear placeholder="请输入MARITAL_STATUS "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="MENSES ">
                  <a-input v-model="queryParam.menses" allow-clear placeholder="请输入MENSES "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="MED_HISTORY ">
                  <a-input v-model="queryParam.medHistory" allow-clear placeholder="请输入MED_HISTORY "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="BODY_EXAM ">
                  <a-input v-model="queryParam.bodyExam" allow-clear placeholder="请输入BODY_EXAM "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="DIAG_DESC ">
                  <a-input v-model="queryParam.diagDesc" allow-clear placeholder="请输入DIAG_DESC "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="CDIAG ">
                  <a-input v-model="queryParam.cdiag" allow-clear placeholder="请输入CDIAG "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="MEDICAL_RECORD ">
                  <a-input v-model="queryParam.medicalRecord" allow-clear placeholder="请输入MEDICAL_RECORD "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="OPERATION_RECORD ">
                  <a-input v-model="queryParam.operationRecord" allow-clear placeholder="请输入OPERATION_RECORD "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="INDIVIDUAL ">
                  <a-input v-model="queryParam.individual" allow-clear placeholder="请输入INDIVIDUAL "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="ADVICE ">
                  <a-input v-model="queryParam.advice" allow-clear placeholder="请输入ADVICE "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="ORDINAL ">
                  <a-input v-model="queryParam.ordinal" allow-clear placeholder="请输入ORDINAL "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="MEMO ">
                  <a-input v-model="queryParam.memo" allow-clear placeholder="请输入MEMO "/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="ILLNESS_DATE ">
                  <a-date-picker style="width: 100%" placeholder="请选择ILLNESS_DATE " v-model="queryParam.illnessDateDate" @change="onChangeillnessDate"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="VISIT_DATE ">
                  <a-date-picker style="width: 100%" placeholder="请选择VISIT_DATE " v-model="queryParam.visitDateDate" @change="onChangevisitDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="WEIGHT ">
                  <a-input v-model="queryParam.weight" allow-clear placeholder="请输入WEIGHT "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="PATHOLOGICSTATUS ">
                  <a-input v-model="queryParam.pathologicstatus" allow-clear placeholder="请输入PATHOLOGICSTATUS "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="REMARK1 ">
                  <a-input v-model="queryParam.remark1" allow-clear placeholder="请输入REMARK1 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="PATHOLOGICDEGREE ">
                  <a-input v-model="queryParam.pathologicdegree" allow-clear placeholder="请输入PATHOLOGICDEGREE "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="REMARK2 ">
                  <a-input v-model="queryParam.remark2" allow-clear placeholder="请输入REMARK2 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="PHYSI_STATUS ">
                  <a-input v-model="queryParam.physiStatus" allow-clear placeholder="请输入PHYSI_STATUS "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="PER_HISTORY ">
                  <a-input v-model="queryParam.perHistory" allow-clear placeholder="请输入PER_HISTORY "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="SUPPORT_EXAM ">
                  <a-input v-model="queryParam.supportExam" allow-clear placeholder="请输入SUPPORT_EXAM "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="CHECK_BOX38 ">
                  <a-input v-model="queryParam.checkBox38" allow-clear placeholder="请输入CHECK_BOX38 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="CHECK_BOX39 ">
                  <a-input v-model="queryParam.checkBox39" allow-clear placeholder="请输入CHECK_BOX39 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="CHECK_BOX40 ">
                  <a-input v-model="queryParam.checkBox40" allow-clear placeholder="请输入CHECK_BOX40 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="CHECK_BOX41 ">
                  <a-input v-model="queryParam.checkBox41" allow-clear placeholder="请输入CHECK_BOX41 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="RISK_FACTOR ">
                  <a-input v-model="queryParam.riskFactor" allow-clear placeholder="请输入RISK_FACTOR "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="PAIN_MARK ">
                  <a-input v-model="queryParam.painMark" allow-clear placeholder="请输入PAIN_MARK "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="RISK ">
                  <a-input v-model="queryParam.risk" allow-clear placeholder="请输入RISK "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="PSY_ASSESSMENT ">
                  <a-input v-model="queryParam.psyAssessment" allow-clear placeholder="请输入PSY_ASSESSMENT "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="PAIN_ASSESSMENT ">
                  <a-input v-model="queryParam.painAssessment" allow-clear placeholder="请输入PAIN_ASSESSMENT "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="FALL_ASSESSMENT ">
                  <a-input v-model="queryParam.fallAssessment" allow-clear placeholder="请输入FALL_ASSESSMENT "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="NUTRITIONAL_STATUS ">
                  <a-input v-model="queryParam.nutritionalStatus" allow-clear placeholder="请输入NUTRITIONAL_STATUS "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="ABNORMAL_EATING ">
                  <a-input v-model="queryParam.abnormalEating" allow-clear placeholder="请输入ABNORMAL_EATING "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="SUGGEST ">
                  <a-input v-model="queryParam.suggest" allow-clear placeholder="请输入SUGGEST "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="LEAVE_DIRECTION ">
                  <a-input v-model="queryParam.leaveDirection" allow-clear placeholder="请输入LEAVE_DIRECTION "/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="LEAVE_DATE ">
                  <a-date-picker style="width: 100%" placeholder="请选择LEAVE_DATE " v-model="queryParam.leaveDateDate" @change="onChangeleaveDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="NORMAL_ASSESSMENT ">
                  <a-input v-model="queryParam.normalAssessment" allow-clear placeholder="请输入NORMAL_ASSESSMENT "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="LANGUAGE_ASSESSMENT ">
                  <a-input v-model="queryParam.languageAssessment" allow-clear placeholder="请输入LANGUAGE_ASSESSMENT "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="SOCIAL_ASSESSMENT ">
                  <a-input v-model="queryParam.socialAssessment" allow-clear placeholder="请输入SOCIAL_ASSESSMENT "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="FAITH ">
                  <a-input v-model="queryParam.faith" allow-clear placeholder="请输入FAITH "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="FAMILY_MEDICAL_HISTORY ">
                  <a-input v-model="queryParam.familyMedicalHistory" allow-clear placeholder="请输入FAMILY_MEDICAL_HISTORY "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="跌倒风险筛查 ">
                  <a-input v-model="queryParam.fallRisk" allow-clear placeholder="请输入跌倒风险筛查 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="性别 ">
                  <a-input v-model="queryParam.patientSex" allow-clear placeholder="请输入性别 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="年龄 ">
                  <a-input v-model="queryParam.patientAge" allow-clear placeholder="请输入年龄 "/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="出生日期 ">
                  <a-date-picker style="width: 100%" placeholder="请选择出生日期 " v-model="queryParam.patientBirthdayDate" @change="onChangepatientBirthday"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="民族 ">
                  <a-input v-model="queryParam.nation" allow-clear placeholder="请输入民族 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="现住址 ">
                  <a-input v-model="queryParam.mailingAddress" allow-clear placeholder="请输入现住址 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="职业 ">
                  <a-input v-model="queryParam.occupation" allow-clear placeholder="请输入职业 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="工作单位 ">
                  <a-input v-model="queryParam.workAddr" allow-clear placeholder="请输入工作单位 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="联系电话 ">
                  <a-input v-model="queryParam.phoneNo" allow-clear placeholder="请输入联系电话 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="会员卡种 ">
                  <a-input v-model="queryParam.vipType" allow-clear placeholder="请输入会员卡种 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="联系人 ">
                  <a-input v-model="queryParam.lxr" allow-clear placeholder="请输入联系人 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="联系人电话 ">
                  <a-input v-model="queryParam.lxrdh" allow-clear placeholder="请输入联系人电话 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="联系人关系 ">
                  <a-input v-model="queryParam.lxrgx" allow-clear placeholder="请输入联系人关系 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="中医诊断 ">
                  <a-input v-model="queryParam.diagDescZy" allow-clear placeholder="请输入中医诊断 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="医嘱项目 ">
                  <a-input v-model="queryParam.yzxm" allow-clear placeholder="请输入医嘱项目 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="流行病史 ">
                  <a-input v-model="queryParam.lxbs" allow-clear placeholder="请输入流行病史 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="患者知情拒绝 ">
                  <a-input v-model="queryParam.isPatientRefuse" allow-clear placeholder="请输入患者知情拒绝 "/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="患者知情拒绝内容 ">
                  <a-input v-model="queryParam.patientRefuseComments" allow-clear placeholder="请输入患者知情拒绝内容 "/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="创建时间">
                  <a-date-picker style="width: 100%" placeholder="请选择创建时间" v-model="queryParam.createDateDate" @change="onChangecreateDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="创建者Id">
                  <a-input v-model="queryParam.createUserId" allow-clear placeholder="请输入创建者Id"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="创建者名称">
                  <a-input v-model="queryParam.createUserName" allow-clear placeholder="请输入创建者名称"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="更新时间">
                  <a-date-picker style="width: 100%" placeholder="请选择更新时间" v-model="queryParam.modifyDateDate" @change="onChangemodifyDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="修改者Id">
                  <a-input v-model="queryParam.modifyUserId" allow-clear placeholder="请输入修改者Id"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="修改者名称">
                  <a-input v-model="queryParam.modifyUserName" allow-clear placeholder="请输入修改者名称"/>
                </a-form-item>
              </a-col><a-col :md="8" :sm="24">
                <a-form-item label="删除时间">
                  <a-date-picker style="width: 100%" placeholder="请选择删除时间" v-model="queryParam.deleteDateDate" @change="onChangedeleteDate"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="删除者ID">
                  <a-input v-model="queryParam.deleteUserId" allow-clear placeholder="请输入删除者ID"/>
                </a-form-item>
              </a-col>
              <a-col :md="8" :sm="24">
                <a-form-item label="删除者姓名">
                  <a-input v-model="queryParam.deleteUserName" allow-clear placeholder="请输入删除者姓名"/>
                </a-form-item>
              </a-col>            </template>

            <a-col :md="8" :sm="24" >
              <span class="table-page-search-submitButtons">
                <a-button type="primary" @click="$refs.table.refresh(true)" >查询</a-button>
                <a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
                <a @click="toggleAdvanced" style="margin-left: 8px"> {{ advanced ? '收起' : '展开' }}
                  <a-icon :type="advanced ? 'up' : 'down'"/>
                </a>
              </span>
            </a-col>

          </a-row>
        </a-form>
      </div>
    </a-card>
    <a-card :bordered="false">
      <s-table
        ref="table"
        :columns="columns"
        :data="loadData"
        :alert="true"
        :rowKey="(record) => record.iD"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
        <template class="table-operator" slot="operator" v-if="hasPerm('OutpMr:add')" >
          <a-button type="primary" v-if="hasPerm('OutpMr:add')" icon="plus" @click="$refs.addForm.add()">新增门诊病例</a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <a v-if="hasPerm('OutpMr:edit')" @click="$refs.editForm.edit(record)">编辑</a>
          <a-divider type="vertical" v-if="hasPerm('OutpMr:edit') & hasPerm('OutpMr:delete')"/>
          <a-popconfirm v-if="hasPerm('OutpMr:delete')" placement="topRight" title="确认删除？" @confirm="() => OutpMrDelete(record)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </s-table>
      <add-form ref="addForm" @ok="handleOk" />
      <edit-form ref="editForm" @ok="handleOk" />
    </a-card>
  </div>
</template>
<script>
  import { STable } from '@/components'
  import moment from 'moment'
  import { OutpMrPage, OutpMrDelete } from '@/api/modular/main/OutpMrManage'
  import addForm from './addForm.vue'
  import editForm from './editForm.vue'
  export default {
    components: {
      STable,
      addForm,
      editForm
    },
    data () {
      return {
        advanced: false, // 高级搜索 展开/关闭
        queryParam: {},
        columns: [
          {
            title: 'VISIT_NO ',
            align: 'center',
            dataIndex: 'visitNo'
          },
          {
            title: 'PATIENT_NAME ',
            align: 'center',
            dataIndex: 'patientName'
          },
          {
            title: 'OPER_DATE ',
            align: 'center',
            dataIndex: 'operDate'
          },
          {
            title: 'DOCTOR_NAME ',
            align: 'center',
            dataIndex: 'doctorName'
          },
          {
            title: 'DOCTOR_CODE ',
            align: 'center',
            dataIndex: 'doctorCode'
          },
          {
            title: 'ILLNESS_DESC ',
            align: 'center',
            dataIndex: 'illnessDesc'
          },
          {
            title: 'ANAMNESIS ',
            align: 'center',
            dataIndex: 'anamnesis'
          },
          {
            title: 'FAMILY_ILL ',
            align: 'center',
            dataIndex: 'familyIll'
          },
          {
            title: 'MARITAL_STATUS ',
            align: 'center',
            dataIndex: 'maritalStatus'
          },
          {
            title: 'MENSES ',
            align: 'center',
            dataIndex: 'menses'
          },
          {
            title: 'MED_HISTORY ',
            align: 'center',
            dataIndex: 'medHistory'
          },
          {
            title: 'BODY_EXAM ',
            align: 'center',
            dataIndex: 'bodyExam'
          },
          {
            title: 'DIAG_DESC ',
            align: 'center',
            dataIndex: 'diagDesc'
          },
          {
            title: 'CDIAG ',
            align: 'center',
            dataIndex: 'cdiag'
          },
          {
            title: 'MEDICAL_RECORD ',
            align: 'center',
            dataIndex: 'medicalRecord'
          },
          {
            title: 'OPERATION_RECORD ',
            align: 'center',
            dataIndex: 'operationRecord'
          },
          {
            title: 'INDIVIDUAL ',
            align: 'center',
            dataIndex: 'individual'
          },
          {
            title: 'ADVICE ',
            align: 'center',
            dataIndex: 'advice'
          },
          {
            title: 'ORDINAL ',
            align: 'center',
            dataIndex: 'ordinal'
          },
          {
            title: 'MEMO ',
            align: 'center',
            dataIndex: 'memo'
          },
          {
            title: 'ILLNESS_DATE ',
            align: 'center',
            dataIndex: 'illnessDate'
          },
          {
            title: 'VISIT_DATE ',
            align: 'center',
            dataIndex: 'visitDate'
          },
          {
            title: 'WEIGHT ',
            align: 'center',
            dataIndex: 'weight'
          },
          {
            title: 'PATHOLOGICSTATUS ',
            align: 'center',
            dataIndex: 'pathologicstatus'
          },
          {
            title: 'REMARK1 ',
            align: 'center',
            dataIndex: 'remark1'
          },
          {
            title: 'PATHOLOGICDEGREE ',
            align: 'center',
            dataIndex: 'pathologicdegree'
          },
          {
            title: 'REMARK2 ',
            align: 'center',
            dataIndex: 'remark2'
          },
          {
            title: 'PHYSI_STATUS ',
            align: 'center',
            dataIndex: 'physiStatus'
          },
          {
            title: 'PER_HISTORY ',
            align: 'center',
            dataIndex: 'perHistory'
          },
          {
            title: 'SUPPORT_EXAM ',
            align: 'center',
            dataIndex: 'supportExam'
          },
          {
            title: 'CHECK_BOX38 ',
            align: 'center',
            dataIndex: 'checkBox38'
          },
          {
            title: 'CHECK_BOX39 ',
            align: 'center',
            dataIndex: 'checkBox39'
          },
          {
            title: 'CHECK_BOX40 ',
            align: 'center',
            dataIndex: 'checkBox40'
          },
          {
            title: 'CHECK_BOX41 ',
            align: 'center',
            dataIndex: 'checkBox41'
          },
          {
            title: 'RISK_FACTOR ',
            align: 'center',
            dataIndex: 'riskFactor'
          },
          {
            title: 'PAIN_MARK ',
            align: 'center',
            dataIndex: 'painMark'
          },
          {
            title: 'RISK ',
            align: 'center',
            dataIndex: 'risk'
          },
          {
            title: 'PSY_ASSESSMENT ',
            align: 'center',
            dataIndex: 'psyAssessment'
          },
          {
            title: 'PAIN_ASSESSMENT ',
            align: 'center',
            dataIndex: 'painAssessment'
          },
          {
            title: 'FALL_ASSESSMENT ',
            align: 'center',
            dataIndex: 'fallAssessment'
          },
          {
            title: 'NUTRITIONAL_STATUS ',
            align: 'center',
            dataIndex: 'nutritionalStatus'
          },
          {
            title: 'ABNORMAL_EATING ',
            align: 'center',
            dataIndex: 'abnormalEating'
          },
          {
            title: 'SUGGEST ',
            align: 'center',
            dataIndex: 'suggest'
          },
          {
            title: 'LEAVE_DIRECTION ',
            align: 'center',
            dataIndex: 'leaveDirection'
          },
          {
            title: 'LEAVE_DATE ',
            align: 'center',
            dataIndex: 'leaveDate'
          },
          {
            title: 'NORMAL_ASSESSMENT ',
            align: 'center',
            dataIndex: 'normalAssessment'
          },
          {
            title: 'LANGUAGE_ASSESSMENT ',
            align: 'center',
            dataIndex: 'languageAssessment'
          },
          {
            title: 'SOCIAL_ASSESSMENT ',
            align: 'center',
            dataIndex: 'socialAssessment'
          },
          {
            title: 'FAITH ',
            align: 'center',
            dataIndex: 'faith'
          },
          {
            title: 'FAMILY_MEDICAL_HISTORY ',
            align: 'center',
            dataIndex: 'familyMedicalHistory'
          },
          {
            title: '跌倒风险筛查 ',
            align: 'center',
            dataIndex: 'fallRisk'
          },
          {
            title: '性别 ',
            align: 'center',
            dataIndex: 'patientSex'
          },
          {
            title: '年龄 ',
            align: 'center',
            dataIndex: 'patientAge'
          },
          {
            title: '出生日期 ',
            align: 'center',
            dataIndex: 'patientBirthday'
          },
          {
            title: '民族 ',
            align: 'center',
            dataIndex: 'nation'
          },
          {
            title: '现住址 ',
            align: 'center',
            dataIndex: 'mailingAddress'
          },
          {
            title: '职业 ',
            align: 'center',
            dataIndex: 'occupation'
          },
          {
            title: '工作单位 ',
            align: 'center',
            dataIndex: 'workAddr'
          },
          {
            title: '联系电话 ',
            align: 'center',
            dataIndex: 'phoneNo'
          },
          {
            title: '会员卡种 ',
            align: 'center',
            dataIndex: 'vipType'
          },
          {
            title: '联系人 ',
            align: 'center',
            dataIndex: 'lxr'
          },
          {
            title: '联系人电话 ',
            align: 'center',
            dataIndex: 'lxrdh'
          },
          {
            title: '联系人关系 ',
            align: 'center',
            dataIndex: 'lxrgx'
          },
          {
            title: '中医诊断 ',
            align: 'center',
            dataIndex: 'diagDescZy'
          },
          {
            title: '医嘱项目 ',
            align: 'center',
            dataIndex: 'yzxm'
          },
          {
            title: '流行病史 ',
            align: 'center',
            dataIndex: 'lxbs'
          },
          {
            title: '患者知情拒绝 ',
            align: 'center',
            dataIndex: 'isPatientRefuse'
          },
          {
            title: '患者知情拒绝内容 ',
            align: 'center',
            dataIndex: 'patientRefuseComments'
          },
          {
            title: '创建时间',
            align: 'center',
            dataIndex: 'createDate'
          },
          {
            title: '创建者Id',
            align: 'center',
            dataIndex: 'createUserId'
          },
          {
            title: '创建者名称',
            align: 'center',
            dataIndex: 'createUserName'
          },
          {
            title: '更新时间',
            align: 'center',
            dataIndex: 'modifyDate'
          },
          {
            title: '修改者Id',
            align: 'center',
            dataIndex: 'modifyUserId'
          },
          {
            title: '修改者名称',
            align: 'center',
            dataIndex: 'modifyUserName'
          },
          {
            title: '删除时间',
            align: 'center',
            dataIndex: 'deleteDate'
          },
          {
            title: '删除者ID',
            align: 'center',
            dataIndex: 'deleteUserId'
          },
          {
            title: '删除者姓名',
            align: 'center',
            dataIndex: 'deleteUserName'
          }
        ],
        tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
        // 加载数据方法 必须为 Promise 对象
        loadData: parameter => {
          return OutpMrPage(Object.assign(parameter, this.switchingDate())).then((res) => {
            return res.data
          })
        },
        selectedRowKeys: [],
        selectedRows: []
      }
    },
    created () {
      if (this.hasPerm('OutpMr:edit') || this.hasPerm('OutpMr:delete')) {
        this.columns.push({
          title: '操作',
          width: '150px',
          dataIndex: 'action',
          scopedSlots: { customRender: 'action' }
        })
      }
    },
    methods: {
      moment,
      /**
       * 查询参数组装
       */
      switchingDate () {
        const queryParamoperDate = this.queryParam.operDateDate
        if (queryParamoperDate != null) {
            this.queryParam.operDate = moment(queryParamoperDate).format('YYYY-MM-DD')
            if (queryParamoperDate.length < 1) {
                delete this.queryParam.operDate
            }
        }
        const queryParamillnessDate = this.queryParam.illnessDateDate
        if (queryParamillnessDate != null) {
            this.queryParam.illnessDate = moment(queryParamillnessDate).format('YYYY-MM-DD')
            if (queryParamillnessDate.length < 1) {
                delete this.queryParam.illnessDate
            }
        }
        const queryParamvisitDate = this.queryParam.visitDateDate
        if (queryParamvisitDate != null) {
            this.queryParam.visitDate = moment(queryParamvisitDate).format('YYYY-MM-DD')
            if (queryParamvisitDate.length < 1) {
                delete this.queryParam.visitDate
            }
        }
        const queryParamleaveDate = this.queryParam.leaveDateDate
        if (queryParamleaveDate != null) {
            this.queryParam.leaveDate = moment(queryParamleaveDate).format('YYYY-MM-DD')
            if (queryParamleaveDate.length < 1) {
                delete this.queryParam.leaveDate
            }
        }
        const queryParampatientBirthday = this.queryParam.patientBirthdayDate
        if (queryParampatientBirthday != null) {
            this.queryParam.patientBirthday = moment(queryParampatientBirthday).format('YYYY-MM-DD')
            if (queryParampatientBirthday.length < 1) {
                delete this.queryParam.patientBirthday
            }
        }
        const queryParamcreateDate = this.queryParam.createDateDate
        if (queryParamcreateDate != null) {
            this.queryParam.createDate = moment(queryParamcreateDate).format('YYYY-MM-DD')
            if (queryParamcreateDate.length < 1) {
                delete this.queryParam.createDate
            }
        }
        const queryParammodifyDate = this.queryParam.modifyDateDate
        if (queryParammodifyDate != null) {
            this.queryParam.modifyDate = moment(queryParammodifyDate).format('YYYY-MM-DD')
            if (queryParammodifyDate.length < 1) {
                delete this.queryParam.modifyDate
            }
        }
        const queryParamdeleteDate = this.queryParam.deleteDateDate
        if (queryParamdeleteDate != null) {
            this.queryParam.deleteDate = moment(queryParamdeleteDate).format('YYYY-MM-DD')
            if (queryParamdeleteDate.length < 1) {
                delete this.queryParam.deleteDate
            }
        }
        const obj = JSON.parse(JSON.stringify(this.queryParam))
        return obj
      },
      OutpMrDelete (record) {
        OutpMrDelete(record).then((res) => {
          if (res.success) {
            this.$message.success('删除成功')
            this.$refs.table.refresh()
          } else {
            this.$message.error('删除失败') // + res.message
          }
        })
      },
      toggleAdvanced () {
        this.advanced = !this.advanced
      },
      onChangeoperDate(date, dateString) {
        this.operDateDateString = dateString
      },
      onChangeillnessDate(date, dateString) {
        this.illnessDateDateString = dateString
      },
      onChangevisitDate(date, dateString) {
        this.visitDateDateString = dateString
      },
      onChangeleaveDate(date, dateString) {
        this.leaveDateDateString = dateString
      },
      onChangepatientBirthday(date, dateString) {
        this.patientBirthdayDateString = dateString
      },
      onChangecreateDate(date, dateString) {
        this.createDateDateString = dateString
      },
      onChangemodifyDate(date, dateString) {
        this.modifyDateDateString = dateString
      },
      onChangedeleteDate(date, dateString) {
        this.deleteDateDateString = dateString
      },
      handleOk () {
        this.$refs.table.refresh()
      },
      onSelectChange (selectedRowKeys, selectedRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectedRows = selectedRows
      }
    }
  }
</script>
<style lang="less">
  .table-operator {
    margin-bottom: 18px;
  }
  button {
    margin-right: 8px;
  }
</style>
